﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Commerce.Contracts;

namespace MusicWorks.Service.DataContracts
{
    public class Address : BaseCommerceEntity
    {
        public const string ModelNameDefintion = "Address";

        public Address()
        {
            this.CommerceEntity = new CommerceEntity(ModelNameDefintion);
        }

        public Address(CommerceEntity commerceEntity) : base(commerceEntity)
        {
            this.CommerceEntity = commerceEntity;
        }

        public static implicit operator Address(CommerceEntity commerceEntity)
        {
            return new Address(commerceEntity);
        }

        /// <summary>
        /// Gets or sets the first line of the address.
        /// </summary>
        /// <value>The line1.</value>
        /// <remarks>The first line of an address. For example,  1 Main Street.</remarks>
        public string Line1
        {
            get { return _commerceEntity.GetPropertyValue(PropertyName.Line1) as string; }
            set { _commerceEntity.SetPropertyValue(PropertyName.Line1, value); }
        }

        /// <summary>
        /// Gets or sets the first line of the address.
        /// </summary>
        /// <value>The line1.</value>
        /// <remarks>The first line of an address. For example,  1 Main Street.</remarks>
        public string Line2
        {
            get { return _commerceEntity.GetPropertyValue(PropertyName.Line2) as string; }
            set { _commerceEntity.SetPropertyValue(PropertyName.Line2, value); }
        }

      


        public class PropertyName : CommerceEntity.PropertyName
        {
            public static string Line1 = "Line1";
            public static string Line2 = "Line2";
        }



    }
}
